package com.toggery.POS.dao;

import com.toggery.POS.entity.Brand;
import com.toggery.POS.entity.BrandExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BrandMapper {
    long countByExample(BrandExample example);

    int deleteByExample(BrandExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Brand record);

    int insertSelective(Brand record);

    List<Brand> selectByExample(BrandExample example);

    Brand selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Brand record, @Param("example") BrandExample example);

    int updateByExample(@Param("record") Brand record, @Param("example") BrandExample example);

    int updateByPrimaryKeySelective(Brand record);

    int updateByPrimaryKey(Brand record);

    @Select({
            "select * from Brand where id=#{id,jdbcType=INTEGER}"
    })
    Brand findById(Integer id);

    @Select({
            "select * from Brand"
    })
    List<Brand> findAll();


    @Select({
            "select * from Brand where Brandname=#{name,jdbcType=VARCHAR} limit 1"
    })
    Brand findByName(String name);

    @Select({
            "select * from Brand where Brandname like #{name,jdbcType=VARCHAR}"
    })
    List<Brand> findLikeName(String name);
}